Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
Text Area with [Object object]

I created a component for my form, it looks like this

import React from "react";

export default function TextArea(name, value, onChange) {
  return (
    <div className="mt-1">
      <textarea
        rows={3}
        className="mt1 block w-full py-1.5 px-3 rounded-md border-2 border-orange-light"
        placeholder="Digite"
        value={value}
        onChange={onChange}
        name={name}
      />
    </div>
  );
}

But when I use it, it stays in an [object object], inside this textarea

But when I use it, it stays in an [object object], inside this textarea

I'm using it on my form this way

 <TextArea
    name="about"
    value={about}
    onChange={(e) => setAbout(e.target.value)} />

Can anyone tell what I should do to fix this? Thanks!

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

Here is the correct TextArea Component code, please try this and it will resolve your issue :)

import React from "react";

export default function TextArea({ name, value, onChange }) {
  return (
    <div className="mt-1">
      <textarea
        rows={3}
        className="mt1 block w-full py-1.5 px-3 rounded-md border-2 border-orange-light"
        placeholder="Digite"
        value={value}
        onChange={onChange}
        name={name}
      />
    </div>
  );
}

about 4 years ago · Juan Pablo Isaza Denunciar

0

First do console.log(value) and find out what is in object , later use it like below with whichever property name your object got.

 value={value.propertyname} 
about 4 years ago · Juan Pablo Isaza Denunciar

0

What parameter do you pass to 'value'? Most likely, what is being passed to the 'value' is an object, check that first so I can help you better.

UPDATE

when declaring the about, maybe it's being declared so that it stays as an object. then declare as:

const [about, setAbout] = useState("");
<TextArea
...,
value={about},
...
>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda